#pragma once

#include "../SGD Wrappers/CSGD_ObjectFactory.h"

#include "ObjectManager.h"
#include "Tile.h"

#include "../SGD Wrappers/SGD_String.h"
typedef CSGD_ObjectFactory< TSTRING, CEntity >	CSGD_Factory;

class CLayer : public CEntity
{
public:
	CLayer(void);
	~CLayer(void);

	//Overloaded from Entity
	void Render(void);
	void Update(float fElapsedTime);
	bool CheckCollision(IEntity* pOther);

	//Accessors
	int GetTopLeftIndex(void) const {return this->m_nTopLeft_Index;} //No mutator, adjusts itself

	//Temporary
	//void SaveTemp(const char* szFileName);
	bool LoadTiles(const char* szFileName);

private:
	//determining which tiles to cull
	int m_nTopLeft_Index;
	//store the Image ID
	int m_nTileImgID;
	//pointer to what will become a massive array of Tiles
	CTile* m_pTiles;

	//TEMP SGD Wrapper objects for testing purposes
	CSGD_Factory*			m_pOF;
	CObjectManager*			m_pOM;
};



////////////
////Add to the .h that we want the test layer
/*
//Testing purposes
#include "Layer.h"

//Testing purposes
CLayer m_TestLayer;
*/


//////////
///Add to the .cpp's Render for the test layer
/*
//Testing if the layer can draw tiles
	this->m_TestLayer.Render();
*/

//Use the following to add a layer to the object manager to handle

/////////////////////////////////////////////////////////
	//////////////////CREATING A LAYER WITH 500 TEST TILES//////////
	////////////DO NOT USE OUTSIDE OF TESTING//////////////////
	///////////////////////////////////////////////////////////
	//CLayer TestLayer;
	//CSGD_Factory::GetInstance()->RegisterClassType<CLayer> (_T("CLayer"));
	//CEntity* pLayer = CSGD_Factory::GetInstance()->CreateObject(_T("CLayer"));
	//CObjectManager::GetInstance()->AddObject(pLayer);
	//////////////////////////////////////////////////////
	/////////////DONE TESTING CODE///////////////////////
	////////////////////////////////////////////////////